<?php

/**
 * HMVC
 */

if (!function_exists('modules_run')) {
  /**
   * Let Twig load HMVC modules
   */
  function modules_run($path)
  {
    echo modules::run($path);
  }
}
if (!function_exists('getActualSection')) {
  function getActualSection($path, $string = 'active', $regexp = TRUE)
  {
    $pattern = str_replace('/', '', $path);
    $subject = str_replace('/', '', $_SERVER['REQUEST_URI']);
    if ($regexp) {
      if (preg_match('/' . $pattern . '/', preg_quote($subject))) {
        return $string;
      } else {
        return '';
      }
    } else {
      if (strpos($pattern, $subject) !== FALSE) {
        return $string;
      } else {
        return '';
      }
    }
  }
}
if (!function_exists('create_link')) {
  function create_link()
  {
    $CI = &get_instance();
    $CI->load->library('AdminPagination');
    return $this->adminpagination->create_links();
  }
}
if (!function_exists('get_uri')) {
  function get_uri($i)
  {
    $CI = &get_instance();
    return $CI->uri->segment($i);
  }
}


/* End of file twiggy_helper.php */